package training02;

/**
 * 角色类
 */
public class Role {
    private String name;
    private int level;

    public Role() {
    }

    public Role(String name, int level) {
        this.name = name;
        this.level = level;
    }

    public void intro(){
        System.out.println("我是" + name + ",我的等级为"+level);
    }

    @Override
    public String toString() {
        return this.name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
